
from wordcloud import WordCloud

text = open(r'.\ciyun.txt', "r").read()
cut_text = jieba.cut(text)
result = '  '.join(cut_text)

wc = WordCloud(
    font_path=r"simhei.ttf",
    background_color='white',
    width=500,
    height=350,
    max_font_size = 500,
    min_font_size=10,
)#max_words=1000),mode='RGBA',colormap='pink')
wc.generate(result)
wc.to_file(r".\wordcloud.png")
plt.figure("ok")
plt.imshow(wc)
plt.axis("off")
plt.show()
